﻿// RegexLearning.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <iostream>
#include <algorithm>

#include "RegexHeaders.h"

int main()
{
    std::cout << "Starting Process!\n";

    std::string in;

    int flag;
    std::cin >> flag;

    switch (flag)
    {
    case 1: {
        std::cout << "----- -----\n";

        std::cout << "提取RobotPlugin前面的所有字符\n";
        std::cin >> in;
        regex pattern01("(.*)RobotPlugin");
        SpiltByRegex(in, pattern01);
        break;
    }
    case 2: {
        std::cout << "----- -----\n";

        std::cout << "删除字符串里所有的数字\n";
        std::cin >> in;
        regex pattern02("\\d");
        ReplaceByRegex(in, pattern02);

        break;
    }
    case 3: {
        std::cout << "----- -----\n";

        std::cout << "删除字符串里所有的大写字母\n";
        std::cin >> in;
        regex pattern03("([A-Z]*)");
        ReplaceByRegex(in, pattern03);

        break;
    }
    case 4: {
        std::cout << "----- -----\n";

        std::cout << "寻找字符串里是否有\n";
        //std::cin >> in;
        in = "Color is #ffAB11";
        regex pattern04("#([a-f]{2})");
        SearchByRegex(in, pattern04);

        break;
    }
    case 5: {
        std::cout << "----- -----\n";

        std::cout << "将字符串里所有的大写字母改为小写\n";
        std::cin >> in;
        StrToLower(in);
        break;
    }
    case 6: {
        std::cout << "----- -----\n";

        std::cout << "将字符串里所有的小写字母改为大写\n";
        std::cin >> in;
        StrToUpper(in);
        break;
    }
    default:
        break;
    }

    
    return 0;
}
